compatible fixes for qt6 warnings and conflicts. (#728)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Mon, 4 Oct 2021 19:17:19 +0000 (13:17 -0600)
committerGitHub <noreply@github.com>
Mon, 4 Oct 2021 19:17:19 +0000 (13:17 -0600)
* quite qt6 yammering about foreach.

* avoid name collision with Qt6.

* fix warning: type qualifiers ignored on cast result type

dmtlog.cc
gui/map.cc
wbt-200.cc

index 37cbbf5744b99417dd6e809272d5febc717a38ee..d37893d0f8cf8609819b6ea8aaa80ca4f95080b7 100644 (file)
--- a/dmtlog.cc
+++ b/dmtlog.cc
@@ -777,7 +777,7 @@ dmtlog_write()
   gbfputint32(4, fout);
   gbfputint32(1, fout);
   gbfputint32(0x100001, fout);
-  gbfputuint32((const uint32_t)gpsbabel_time, fout);
+  gbfputuint32((uint32_t)gpsbabel_time, fout);
 
   header_written = 0;
   this_index = 0;
index 9e1d1b938705dd03687200b7ae493b8b73812200..e3034bbf14d798ac0ff4c534028353e414a471ac 100644 (file)
@@ -146,7 +146,7 @@ static QString makePath(const vector <LatLng>& pts)
   QString path;
   int lncount = 0;
   bool someoutput = false;
-  foreach (const LatLng ll, pts) {
+  for (const auto& ll : pts) {
     if (lncount == 0) {
       if (someoutput) {
         path.append(QChar(','));
index 8987b23b0a267a8e4598e0070f9ee272803ffdf6..8cf0e5bc90088b105317ba05b60a6c71948e01ad 100644 (file)
@@ -91,7 +91,7 @@ static struct {
 static void* fd;
 static FILE* fl;
 static char* port;
-static char* erase;
+static char* opt_erase;
 
 enum wintec_gps_types {
   UNKNOWN, WBT200, WBT201, WSG1000
@@ -758,7 +758,7 @@ static void wbt200_data_read()
 
   /* Erase data? */
 
-  if (*erase != '0') {
+  if (*opt_erase != '0') {
     int f;
     db(1, "Erasing data\n");
     for (f = 27; f <= 31; f++) {
@@ -967,7 +967,7 @@ static void wbt201_data_read()
     }
   }
 
-  if (*erase != '0') {
+  if (*opt_erase != '0') {
     /* erase device */
     do_simple("@AL,5,6", BUFSPEC(line_buf));
   }
@@ -1056,7 +1056,7 @@ static void data_read()
 
 static QVector<arglist_t> wbt_sargs = {
   {
-    "erase", &erase, "Erase device data after download",
+    "erase", &opt_erase, "Erase device data after download",
     "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
   },
 };